$fn=100;
s=10;
t=1;

intersection(){
    translate([-s,-s*2,-s])cube(s*2);
    union(){
        translate([-s,0,0])difference(){
            sphere(s);
            sphere(s-t);
        }
        translate([s,0,0])difference(){
            sphere(s);
            sphere(s-t);
        }
    }
}

intersection(){
    cylinder(20,s,s,center=true);
    rotate_extrude(angle=180)
        translate([s,0,0])difference(){
            circle(s);
            circle(s-t);
        }
}

translate([0,0,-s+t/2])
    rotate_extrude(angle=180) translate([s,0,0])circle(t/2);
translate([0,0,s-t/2])
    rotate_extrude(angle=180) translate([s,0,0])circle(t/2);
    
rotate([180,90,0])translate([0,0,s])
    rotate_extrude(angle=180) translate([s-t/2,0,0])circle(t/2);
rotate([180,90,0])translate([0,0,-s])
    rotate_extrude(angle=180) translate([s-t/2,0,0])circle(t/2);
    
